#pragma once

#include "framework.h"
using namespace poly;

enum PrimitiveType
{
	PT_LineList      = D3DPT_LINELIST,
	PT_LineStrip     = D3DPT_LINESTRIP,
	PT_PointList     = D3DPT_POINTLIST,
	PT_TriangleFan   = D3DPT_TRIANGLEFAN,
	PT_TriangleList  = D3DPT_TRIANGLELIST,
	PT_TriangleStrip = D3DPT_TRIANGLESTRIP
};

class Renderer
{
public:
	Renderer();
	Renderer(D3DDevice device);
	~Renderer();

	void setDevice(D3DDevice device);
	void destroy();
	void setup(const poly::Polygon &poly, const poly::Polygon &color);
	void setup(const poly::Polygon &poly, float3 color);
	void render(int PrimitiveType, uint32 PrimitiveCount);

private:
	D3DDevice               m_Device;
	VertexBuffer	        m_vertexBuffer;
	DWORD		     	    m_Fvf;
	uint32                  m_VertSize;
};